<?php

/**
 * Products form.
 *
 * @package    form
 * @subpackage products
 * @version    SVN: $Id: sfPropelFormTemplate.php 6174 2007-11-27 06:22:40Z fabien $
 */
class ProductsForm extends BaseProductsForm
{
  public function configure()
  {
  
  unset($this['created_at']);
  unset($this['updated_at']);
  unset($this['deleted_at']);

  $this->widgetSchema['categories_id'] = new sfWidgetFormPropelSelectMany(array('model' => 'Categories'));
  $this->validatorSchema['categories_id'] = new sfValidatorPass();
  $this->widgetSchema['products_image'] = new sfWidgetFormInputFile();
  $this->validatorSchema['products_image'] = new sfValidatorFile();  
  $this->validatorSchema['products_quantity'] = new sfValidatorInteger(array('required' => false), array('min' => 1), array( 'min' => '1 minimum'));
  $this->validatorSchema['products_model'] = new sfValidatorString(array('required' => false), array('min_length' => 2, 'max_length' => 50), array( 'min_length' => '2 character minumun', 'max_length' => '50 character maximum'));
  $this->validatorSchema['products_price'] = new sfValidatorNumber(array('required' => false), array('min' => 1), array('min' => '1 minimum'));
  $this->validatorSchema['products_weight'] = new sfValidatorNumber(array('required' => false), array('min' => 1), array('min' => '1 minimum'));
  $this->validatorSchema['products_status'] = new sfValidatorBoolean(array('required' => false), array(), array('invalid' => 'This value is not valid'));
  $this->validatorSchema['products_ordered'] = new sfValidatorInteger(array('required' => false), array('min' => 0), array('min' => '1 minimun'));
  $this->validatorSchema['products_date_available'] = new sfValidatorDate(array('required' => false));
  $this->validatorSchema['products_tax_class_id'] = new sfValidatorInteger(array('min' => 1), array( 'min' => '1 minimum'));
  $this->validatorSchema['manufacturers_id'] = new sfValidatorInteger(array('min' => 1), array( 'min' => '1 minimum'));
  $this->embedI18n(LanguagesPeer::getCodesInArray());
  }
}